home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / glibc108.zip / glibc108 / gnu-stabs.h < prev    next >
C/C++ Source or Header  |  1992-03-14  |  3KB  |  90 lines

  1. /* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef    __GNU_STABS_H
  20.  
  21. #define    __GNU_STABS_H    1
  22.  
  23. #ifdef    HAVE_GNU_LD
  24.  
  25. /* Alias a function:
  26.        function_alias(creat, _creat, int, (file, mode),
  27.                DEFUN(creat, (file, mode),
  28.                      CONST char *file AND int mode))
  29.    Yes, this is very repetitive.  Nothing you can do about it, so shut up.  */
  30. #define    function_alias(name, _name, type, args, defun) \
  31.   symbol_alias (_name, name);
  32.  
  33. #define function_alias_void(name, _name, args, defun) \
  34.   symbol_alias (_name, name);
  35.  
  36. /* Make references to ALIAS refer to SYMBOL.  */
  37. #ifdef    __STDC__
  38. #define    symbol_alias(symbol, alias)    \
  39.   asm(".stabs \"" "_" #alias "\",11,0,0,0\n"\
  40.       ".stabs \"" "_" #symbol "\",1,0,0,0")
  41. #else
  42. /* Your assembler better grok this right!  */
  43. #define    symbol_alias(symbol, alias)    \
  44.   asm(".stabs \"_/**/alias\",11,0,0,0\n.stabs \"_/**/symbol\",1,0,0,0")
  45. #endif
  46.  
  47. /* Issue a warning message from the linker whenever SYMBOL is referenced.  */
  48. #ifdef    __STDC__
  49. #define    warn_references(symbol, msg)    \
  50.   asm(".stabs \"" msg "\",30,0,0,0\n"    \
  51.       ".stabs \"_" #symbol "\",1,0,0,0")
  52. #else
  53. #define    warn_references(symbol, msg)    \
  54.   asm(".stabs msg,30,0,0,0\n.stabs \"_/**/symbol\",1,0,0,0")
  55. #endif
  56.  
  57. #ifdef    __STDC__
  58. #define    stub_warning(name) \
  59.   warn_references(name, \
  60.           "warning: " #name " is not implemented and will always fail")
  61. #else
  62. #define    stub_warning(name) \
  63.   warn_references(name, \
  64.           "warning: name is not implemented and will always fail")
  65. #endif
  66.  
  67. #ifdef    __STDC__
  68. #define    text_set_element(set, symbol)    \
  69.   asm(".stabs \"_" #set "\",23,0,0,_" #symbol)
  70. #define    data_set_element(set, symbol)    \
  71.   asm(".stabs \"_" #set "\",25,0,0,_" #symbol)
  72. #else
  73. #define    text_set_element(set, symbol)    \
  74.   asm(".stabs \"_/**/set\",23,0,0,_/**/symbol")
  75. #define    data_set_element(set, symbol)    \
  76.   asm(".stabs \"_/**/set\",25,0,0,_/**/symbol")
  77. #endif
  78.  
  79. #else    /* No GNU stabs.  */
  80.  
  81. #define    function_alias(name, _name, type, args, defun) \
  82.   type defun { return _name args; }
  83.  
  84. #define function_alias_void(name, _name, args, defun) \
  85.   void defun { _name args; }
  86.  
  87. #endif    /* GNU stabs.  */
  88.  
  89. #endif    /* gnu-stabs.h  */
  90.